package book;

public class BookList {

    public Book[] books = new Book[100];//总共有一百本书
        public int usedSize;//书籍的有效个数
        //接下来我可以创建一个接口类型的数组
    public BookList() {
            books[0] = new Book("java编程思想","埃克尔",98);
            books[1] = new Book("C和指针","KennethA.Reek",55);
            books[2] = new Book("深入理解计算机系统","Randal E.Bryant",188);
            books[3] = new Book("编译原理","陈意云",49);
            books[4] = new Book("算法第四版","Robert SedgeWick",102);
        this.usedSize = 5;
    }

    //得到下标的这本书
    public Book getPos(int pos) {
        return books[pos];
    }
    //将这个下标设置为一本书
    public void setBook(int pos,Book book) {
        books[pos] = book;
    }

    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }
}
